package com.leyou.item.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.leyou.item.dto.SkuDTO;
import com.leyou.item.dto.SpuDetailDTO;
import com.leyou.item.entity.Sku;
import com.leyou.item.mapper.SkuMapper;
import com.leyou.item.service.SkuService;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SkuServiceImpl extends ServiceImpl<SkuMapper, Sku> implements SkuService {

    @Override
    public List<SkuDTO> queryBySpuId(Long spuId) {
        //根据spuI的查询sku详情
        List<Sku> skuList = query().eq("spu_id", spuId).list();
        //返回
        return SkuDTO.convertEntityList(skuList) ;
    }
}
